/*
**  File: AquaAssign.h
*/
int main( int argc, char *argv[] );
static void Get_Triplets(void);
static Boolean Atom_In_A_Triplet (int idx_atom, int *tri_idx);
static void Check_Triplets ( int *todo_count );
static Boolean External_Assigned(int atom_idx, Boolean *swapped);
static void Partition_Triplets(int todo_count);
static void Swap_Triplets(int i, int j);
static void Sort_Triplets(int todo_count);
static Boolean Triplet_Order (Triplet tri_1, Triplet tri_2);
static void Print_Triplets (int todo_count, int ass_count);
static char Boolean_To_Char(Boolean boo);
static Boolean Char_To_Boolean(char ch);
static void Write_Assignments (int ass_count);
static void Assign_Triplets(int todo_count, int *ass_count);
static Boolean Pick_Triplet(Boolean *tri_done, int *best, int todo_count);
static int Number_Assigned_Contacts(int tri_idx);
static void Init_Extra_Distinfl(void);
static Boolean Atom_Assigned(int at_idx, int *tri_idx);
static void Init_Boolean_Array (Boolean *array, int count, Boolean value);
static Boolean Assign_A_Triplet (int pick, int *ass_count);
       /* Checks if the given triplet can be assigned and does so if possible */
static double Energy_Restraint (int rstrt_idx, int triplet_idx,
		                Boolean swap_state, double **per_mdl_st);
static double Energy_Model ( int struct_idx, int rstrt_idx, int val_idx,
			     double upper, double lower );
	
	
static int Swapped_Value (int value);
static Boolean Triplet_Restraint(int rstrt_idx, int tri_idx, int *idx);
static void Fill_Dmatrix (double **per_mdl_st, int i1, int i2, int j1, int j2, double x);
static void Write_Atom( FILE *fp, Atom *at);
static void Read_AssignDAT(void);
static int Atom_Index(int resnum, ID atonam, ID chain);
static void Write_Corrected_Restraints (void);
static double Best_Value(double val1, double val2, Boolean swap);
static void Swap_Doubles ( double *a, double *b );
static double my_fabs ( double a );
static void Find_Sames(int *list, Boolean *done, int rst_idx,
		Boolean boo_A, Boolean boo_B, int *list_count);
